#include <locale>
#include <iostream>
#include <windows.h>
#include <vector>
using namespace std;



vector<wstring> locals;

BOOL CALLBACK MyFuncLocaleEx(LPWSTR pStr, DWORD dwFlags, LPARAM lparam)
{
    locals.push_back(pStr);
    return TRUE;
}

int main()
{


 EnumSystemLocalesEx(MyFuncLocaleEx, LOCALE_ALL, NULL, NULL);

    for (vector<wstring>::const_iterator str = locals.begin(); str != locals.end(); ++str)
        wcout << *str << endl;

    wcout << "Total " << locals.size() << " locals found." << endl;

    // return 0;

	wcout.imbue(locale {});
	wcout << 32767 << endl;

	wcout.imbue(locale{ "C" });
	wcout << 32767 << endl;
	
	locale loc ("en-US");

	wcout.imbue(loc); // "en_US" for POSIX
	wcout << 32767 << endl;
}